home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ansi / swears10.zip / DEMO.C < prev    next >
C/C++ Source or Header  |  1991-06-25  |  1KB  |  74 lines

  1. #include "swears.h"
  2. extern int _attr;
  3.  
  4. int main()
  5. {
  6.     int i,j;
  7.     WINDOW *w1, *w2, *w3, *w4, *w5;
  8.  
  9.     if( initscr() == ERR )
  10.         return(-1);
  11.  
  12.     refresh();
  13.  
  14.     if( (w1 = newwin(5,5,10,20)) == NULL ) {
  15.         printf("w1 = newwin() error\n");
  16.         return(-1);
  17.     }
  18.     _attr = 0x1700;
  19.     for(i=0;i<100;i++)
  20.         waddch(w1,65);
  21.     wrefresh(w1);
  22.  
  23.     if( (w2 = newwin(15,15,20,30)) == NULL ) {
  24.         printf("w2 = newwin() error\n");
  25.         return(-1);
  26.     }
  27.     _attr = 0x2700;
  28.     for(i=0;i<100;i++)
  29.         waddch(w2,66);
  30.     wrefresh(w2);
  31.  
  32.     if( (w3 = newwin(2,30,5,30)) == NULL ) {
  33.         printf("w3 = newwin() error\n");
  34.         return(-1);
  35.     }
  36.     _attr = 0x3700;
  37.     for(i=0;i<100;i++)
  38.         waddch(w3,67);
  39.     wrefresh(w3);
  40.  
  41.     if( (w4 = newwin(12,40,19,79)) == NULL ) {
  42.         printf("w4 = newwin() error\n");
  43.         return(-1);
  44.     }
  45.     _attr = 0x4700;
  46.     for(i=0;i<100;i++)
  47.         waddch(w4,68);
  48.     wrefresh(w4);
  49.  
  50.     if( (w5 = newwin(20,50,22,80)) == NULL ) {
  51.         printf("w5 = newwin() error\n");
  52.         return(-1);
  53.     }
  54.     _attr = 0x5700;
  55.     for(i=0;i<100;i++)
  56.         waddch(w5,69);
  57.     wrefresh(w5);
  58.  
  59.     addstr("This is a test string printed using the addstr() function...");
  60.     move(5,5);
  61.     addstr("at 5,5 this string should print...");
  62.     mvaddstr(10,10,"at 10,10 for this one...");
  63.     refresh();
  64.  
  65.     delwin(w1);
  66.     delwin(w2);
  67.     delwin(w3);
  68.     delwin(w4);
  69.     delwin(w5);
  70.  
  71.     endwin();
  72.     return(0);
  73. }
  74.